<?php
namespace App\Modules\Adv;
use App\Modules\AdapterApi;
use App\Services\Adv\AdvIndex;
/**
 * Created by PhpStorm.
 * User: 97606
 * Date: 2018/6/12
 * Time: 10:10
 */
class Adv extends AdapterApi
{
    //添加广告位
    public function addAdv()
    {
        $data = pick_array($this->postData, ['name','jump_url','order','img_url']);
        return AdvIndex::Adv()->addAdv($data);
    }

     // 获取广告详情
    public function advinfo()
    {
        $data = pick_array($this->postData, ['id']);
        return AdvIndex::Adv()->advinfo($data);
    }
    //编辑广告位
    public function editAdv()
    {
         $data = pick_array($this->postData, ['id','jump_url','order','name','img_url']);
        return AdvIndex::Adv()->advEdit($data);
    }

     //删除广告位
    public function deleteAdv()
    {
        $data = pick_array($this->postData, ['id']);
        return AdvIndex::Adv()->advDelete($data);
    }
     //启用广告位
    public function enableAdv()
    {
        $data = pick_array($this->postData, ['id']);
        return AdvIndex::Adv()->advEnable($data);
    }
    //禁用广告位
    public function disableAdv()
    {
        $data = pick_array($this->postData, ['id']);
         return AdvIndex::Adv()->advDisable($data);
    }
    //审核通过广告位
    public function advAudit()
    {
         $data = pick_array($this->postData, ['id','auditor_id']);
         return AdvIndex::Adv()->advAudit($data);
    }
     //审核失败/不通过某个广告位
    public function advAuditFailure()
    {
        $data = pick_array($this->postData, ['id','auditor_id']);
         return AdvIndex::Adv()->advAuditFailure($data);
    }
     //某一类广告位列表获取
    public function advClassList()
    {
       $data = pick_array($this->postData, ['c_id', 'listRows', 'page']);
       return AdvIndex::Adv()->advClassList($data);
    }
     //不同状态广告位列表获取
    public function advDifferenceStatus()
    {
        $data = pick_array($this->postData, ['audit_status', 'listRows', 'page']);
        return AdvIndex::Adv()->advDifferenceStatus($data);
    }
     //全部广告位列表获取
    public function advList()
    {
        $data = $this->postData;
        return AdvIndex::Adv()->advList($data);
    }
    //规定上架时间内 正常状态 审核通过的广告位等
    public function advTimeLimit()
    {
        $data = pick_array($this->postData, ['c_id', 'action', 'limit']);
        return AdvIndex::Adv()->advTimeLimit($data);
    }

}